<?php
namespace Api\Service;

/**
 * 广告
 */
class AdService
{
    public function user()
    {
        $banner = S('banner_user');
        if (!$banner || true) {

            $banner = M('banner')
                ->field('url,image')
                ->where([
                    'type'    => 1,
                    'is_show' => 1,
                ])
                ->order('sort desc, id desc')
                ->select();

            S('banner_user', $banner, 3600);
        }

        return $banner ? $banner : [];
    }
}
